package io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream out = new FileOutputStream("C:\\Users\\DELL\\IdeaProjects\\jsd2502\\test.txt");
        String str="hello world";
        byte[] data = str.getBytes(StandardCharsets.UTF_8);
        out.write(data);
        out.close();

    }
}
